package sadmin

import (
	"github.com/astaxie/beego/orm"
)

type Us struct {
	Id int
	Introduce string
	Name string
	Addr string
	Email string
	Tel string
	Opentime string
}

func init()  {
	orm.RegisterModel(new(Us))
}


func UsShow() Us {
	o := orm.NewOrm()
	co := new(Us)
	qs := o.QueryTable(co)
	i,_:=qs.Count()
	com:=Us{Id:int(i)}
	_=o.Read(&com,"id")
	return com
}

func UsEdit(u Us) error  {
	o := orm.NewOrm()
	_, err := o.Insert(&u)
	return err
}